﻿using MES.Core;
using MES.Model.System;

namespace MES.Service.System.Menu
{
    public class MenuService : IMenuService
    {
        private readonly IDataBaseService _dataBaseService;
        public MenuService(IDataBaseService dataBaseService)
        {
            _dataBaseService = dataBaseService;
        }
        public async Task<OperateResult> AddMenuAsync(Sys_Menu menu)
        {
            var res = await _dataBaseService.sqlSugarClient.Insertable<Sys_Menu>(menu).ExecuteCommandAsync();

            return res > 0 ? OperateResult.Success("添加成功") : OperateResult.Fail("添加失败");
        }
    }
}
